{extend name="layout"}

{block name="content"}
<!-- wrapper-content -->
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">

            <div class="ibox-content m-b-sm border-bottom">
                <div class="p-xs">
                    <div class="float-left m-r-md">
                        <i class="fa fa-key text-navy mid-icon"></i>
                    </div>
                    <h2>系统角色管理</h2>
                    <span>角色组可以有多个,角色有上下级层级关系,如果子角色有角色组和管理员的权限则可以派生属于自己组别的下级角色组或管理员。</span>
                </div>
            </div>

            <div class="ibox ">
                <div class="ibox-title">
                    <h5>系统角色管理 </h5>
                </div>
                <div class="ibox-content">

                    <div class="row m-b">
                        <div class="col-sm-12">
                            <div class="toolbar-btn-action">
                                <a href="javascript:;" class="btn btn-primary btn-refresh page-reload" title="刷新"><i
                                        class="fa fa-refresh"></i> </a>
                                <a title="添加" class="btn btn-success" href="{:url('admin/role/add')}"><i
                                        class="fa fa-plus-circle"></i> 添加</a>
                                <a title="删除" class="btn btn-danger ajax-post confirm" target-form="ids"
                                    href="{:url('admin/role/delete')}"><i
                                        class="fa fa-times-circle-o"></i> 删除</a>
                            </div>
                        </div>
                    </div>

                    <div class="table-responsive">
                        <table class="table table-bordered table-hover">
                            <thead>
                                <tr>
                                    <th><input type="checkbox" class="i-checks checkbox-master"> </th>
                                    <th>ID </th>
                                    <th>名称</th>
                                    <th>描述</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                {volist name="list" id="vo"}
                                <tr>
                                    <td class="align-middle">{if $vo.id!=1}<input type="checkbox" class="i-checks ids" name="ids[]" value="{$vo.id}">{/if}</td>
                                    <td class="align-middle">{$vo.id}</td>
                                    <td class="align-middle">{$vo.title_display|raw}</td>
                                    <td class="align-middle">{$vo.remark}</td>
                                    <td class="align-middle">
                                        {if $vo.status==1}
                                        <b class="text-success">使用中</b>
                                        {else}
                                        <b class="text-warning">禁用中</b>
                                        {/if}
                                    </td>
                                    <td class="align-middle tooltip-demo">
                                        {if $vo.id!=1}
                                        {if $vo.status==1}
                                        <a href="{:url('admin/role/editStatus?id='.$vo.id.'&type=2')}"
                                            class="btn btn-warning btn-xs ajax-get confirm" _tag="disable"
                                            data-toggle="tooltip" data-placement="top" title="禁用"><i
                                                class="fa fa-close"></i></a>
                                        {else /}
                                        <a href="{:url('admin/role/editStatus?id='.$vo.id.'&type=1')}"
                                            class="btn btn-success btn-xs ajax-get confirm" _tag="enable"
                                            data-toggle="tooltip" data-placement="top" title="启用"><i
                                                class="fa fa-check"></i></a>
                                        {/if}
                                        <a href="{:url('admin/role/edit?id='.$vo.id)}" class="btn btn-primary btn-xs" _tag="edit"
                                            data-toggle="tooltip" data-placement="top" title="修改"><i
                                                class="fa fa-pencil"></i></a>
                                        <a href="{:url('admin/role/delete?id='.$vo.id)}"
                                            class="btn btn-danger btn-xs ajax-get confirm" _tag="delete"
                                            data-toggle="tooltip" data-placement="top" title="删除"><i
                                                class="fa fa-trash"></i></a>
                                        {/if}
                                    </td>
                                </tr>
                                {/volist}

                            </tbody>
                        </table>
                    </div>

                </div>
            </div>

        </div>
    </div>

</div>

{/block}

